﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace bankCheckAudio
{
    public delegate void showViewEvent();

    public partial class ProgressForm : Form
    {
        public ProgressForm()
        {
            InitializeComponent();
        }

        public showViewEvent viewFunc;

        private void ProgressForm_Load(object sender, EventArgs e)
        {
            if (this.viewFunc != null)
            {
                this.viewFunc();
            }
        }


        public void SetEvent(showViewEvent show)
        {
            this.viewFunc = show;
        }

        public void SetPro(string title,string des,int cur,int all)
        {
            this.lab_des.Text = des;
            this.lab_pro.Text = string.Format("进度:{0}%",((float)cur/all)*100 );
            this.progressBar1.Value = (int)(cur*1.0 / all)*100;

            if (this.progressBar1.Value >= 100)
            {
                this.Close();
            }
        }
    }
}
